# -*- coding: utf-8 -*-
import time
from threading import Thread


def countdown(n):
    while n > 0:
        print('T-minus', n)
        n -= 1
        time.sleep(1)


def thread_test01():
    t = Thread(target=countdown, args=(10,))
    t.start()

    while t.is_alive():
        print('Still running')
        time.sleep(2)
    else:
        print('Done')


def thread_test02():
    t = Thread(target=countdown, args=(10,), daemon=True)
    t.start()
    t.join()


thread_test02()
print("main thread is finished!")
